package cn.iocoder.yudao.module.bpm.dal.mysql.tbcheck;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.bpm.dal.dataobject.tbcheck.TbCheckDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.bpm.controller.admin.tbcheck.vo.*;

/**
 * 图斑检查审批 Mapper
 *
 * @author admin
 */
@Mapper
public interface TbCheckMapper extends BaseMapperX<TbCheckDO> {

    default PageResult<TbCheckDO> selectPage(TbCheckPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<TbCheckDO>()
                .eqIfPresent(TbCheckDO::getId, reqVO.getId())
                .eqIfPresent(TbCheckDO::getApplicant, reqVO.getApplicant())
                .eqIfPresent(TbCheckDO::getDept, reqVO.getDept())
                .eqIfPresent(TbCheckDO::getCheckTime, reqVO.getCheckTime())
                .betweenIfPresent(TbCheckDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TbCheckDO::getId));
    }

    default List<TbCheckDO> selectList(TbCheckExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<TbCheckDO>()
                .eqIfPresent(TbCheckDO::getId, reqVO.getId())
                .eqIfPresent(TbCheckDO::getApplicant, reqVO.getApplicant())
                .eqIfPresent(TbCheckDO::getDept, reqVO.getDept())
                .eqIfPresent(TbCheckDO::getCheckTime, reqVO.getCheckTime())
                .betweenIfPresent(TbCheckDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(TbCheckDO::getId));
    }

}
